import { Controller, UseGuards } from '@nestjs/common';
import { ApiUseTags, ApiBearerAuth } from '@nestjs/swagger';
import { Crud } from 'nestjs-mongoose-crud'
import { Selle } from '@lib/db/models/selle.model';
import { InjectModel } from 'nestjs-typegoose';
import { ModelType } from '@typegoose/typegoose/lib/types';
import { AuthGuard } from '@nestjs/passport';

@Crud({
  model: Selle,
  routes: {
    find: {
      populate: ['commodities']
    }
  }
})
@Controller('selles')
@ApiUseTags('店铺')
@UseGuards(AuthGuard('jwt'))
@ApiBearerAuth()
export class SellesController {
  constructor(
    @InjectModel(Selle) private readonly model: ModelType<Selle>
  ) {}
}
